package com.example.demo.dao;


import java.util.List;

import com.example.demo.entity.Role;
import com.example.demo.entity.RoleAndPermission;
import com.example.demo.mapper.RoleMapper;

/**
 * jdbc操作角色类
 * @author Henry.Y
 * 2019年5月17日
 */
public class RoleDao extends BaseDao implements RoleMapper{

	public int createRole(String sqlId,Role role){
		
		return operateInsertSql(sqlId,role);
	}
	
    public int deleteRole(String sqlId,String id){
    	
    	return operateDeleteSql(sqlId,id);
    }
     
	public int correlatePermission(String sqlId,List<RoleAndPermission> roleAndPermissionList){
		
		return operateInsertSql(sqlId,roleAndPermissionList);	
	}
	
	public int uncorrelatePermission(String sqlId,RoleAndPermission roleAndPermission){
		
		return operateDeleteSql(sqlId,roleAndPermission);
	}
	
	public int deleteRoleTable(String sqlId){
		
		return deleteForFullTable(sqlId);
	}
	
}
